﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Zerg
{
	public class ActionProduceNydusNetwork : ActionProduceFromDrone
	{
		public static ActionProduceNydusNetwork Instance = new ActionProduceNydusNetwork();
		private ActionProduceNydusNetwork() : base(50, 150, 200) { }
		public override ZergState.ZergBuilding GetBuilding(ZergState state) { return state.NydusNetwork; }
		public override string EventName { get { return "ActionSpawnNydusNetwork"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			return state.Lair.Count > 0;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			return base.IsInvalid(bo) || state.Lair.Total == 0;
		}
		private IAction[,] m_Requirements;
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionProduceLair.Instance } };
				return m_Requirements;
			}
		}
	}
}
